package com.kent.hellokotlin.cClassAndObject

//嵌套类与内部类

private class Outer1 {
    val bar = 1

    class Nested {
        fun foo() = 2 + bar
    }
}

private class Outer2 {
    val bar = 1

    inner class Inner {
        fun foo() = 2 + bar
    }
}

private fun foo() {
    println(Outer1.Nested().foo())
    println(Outer2().Inner().foo())

}

fun main() {
    foo()
}